home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1997 September
/
Macworld (1997-09).dmg
/
Serious Software
/
Cherwell Scientific Demos
/
pro Fit
/
pro Fit 5.0 demo (fpu).sea
/
pro Fit 5.0 demo (fpu)
/
Functions & Programs
/
•Gadgets
/
drawing macros
/
arrow
next >
Wrap
Text File
|
1996-06-01
|
1KB
|
48 lines
{
This program draws the outline of a (big) arrow at the last clicked
point in the drawing window.
This program does not bring up any dialog box. The dimensions of the
arrow and its orientation are set in the procedure initialize, below.
To use the program, hit cmd-L (or click the Add button), look at its
keyboard equivalent in the Misc menu, clik in the drawing window,
and run the program. Then click somewhere else and run the program again.
Note that in contrast to pro Fit's arrow styles in the tool palette,
the arrow drawn by this program is a closed polygon that can be colored
and filled in as many ways as you like.
}
program drawArrow;
var ang,h,v,
thick,shaftlength,tiplength,tipwidth:real;
procedure initialize;
begin
shaftlength:=35; { the length of the body of the arrow }
thick:=3; { its half thickness }
tiplength:=15; { the length of the tip }
tipwidth:=5; { the width of the tip }
ang:=-100; { the orientation of the arrow in degrees }
ang:=ang*pi/180; { move to radians}
end;
procedure l(x,y:real);
{ performs a rotation of the coordinates and issues a "line" command }
begin
line(cos(ang)*x+sin(ang)*y,-sin(ang)*x + cos(ang)*y);
end;
begin
GetClickedCoord(h,v);
openpoly(0,1);
moveto(h,v);
l(shaftlength,0);
l(0,-tipwidth);
l(tiplength,tipwidth+thick);
l(-tiplength,tipwidth+thick);
l(0,-tipwidth);
l(-shaftlength,0);
closepoly;
end;